<template>
  <div>
    <div class="banner" @click="handlerGallarShow">
      <img class="banner-img" :src="bannerImg" alt="" />
      <div class="banner-info">
        <div class="banner-title">{{ sightName }}</div>
        <span class="banner-number iconfont icon-tupian">
          {{ this.gallaryImgs.length }}
        </span>
      </div>
    </div>
    <fadeAnimation>
      <gallary
        :imgs="gallaryImgs"
        v-if="gallarShow"
        @gallarClose="handlerGallarClose"
      ></gallary>
    </fadeAnimation>
  </div>
</template>

<script>
import gallary from '@/common/gallary/gallary.vue'
import fadeAnimation from '@/common/fade/fade.vue'
export default {
  name: 'DetailBanner',
  components: { gallary, fadeAnimation },
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      gallarShow: false,
      imgs: []
    }
  },
  methods: {
    handlerGallarShow () {
      this.gallarShow = true
    },
    handlerGallarClose () {
      this.gallarShow = false
    }
  },
  computed: {}
}
</script>

<style lang="scss">
.banner {
  overflow: hidden;
  padding-bottom: 54%;
  position: relative;
  height: 0;
  .banner-img {
    width: 100%;
  }
  .banner-info {
    padding: 0 10px;
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    line-height: 50px;
    color: #fff;
    .banner-title {
      flex: 1;
      font-size: 24px;
    }
    .banner-number {
      margin-top: 10px;
      line-height: 30px;
      height: 30px;
      padding: 0 10px;
      border-radius: 10px;
      background-color: rgba(0, 0, 0, 0.8);
      font-size: 18px;
    }
  }
}
</style>
